<template>
    <div>
        <el-card class="box-card">
            <el-tabs v-model="activeName" @tab-click="handleClick">
                <el-tab-pane :key="item.name" v-for="(item,index) in getfilterModel" :label="item.name" :name="item.name">
                    <order-list-item v-if="item.name == activeName" :tab-value="tabValue" :filter-model="filterModel" ></order-list-item>
                </el-tab-pane>
            </el-tabs>
        </el-card>
    </div>
</template>
<script>
import { ticketList } from '@/api/ticket/ticket'
export default {
    name: 'TicketSystemAdminOrderList',
    components: {
        'order-list-item': () => import('./order_list_item'),
    },
    data() {
        return {
            activeName: "全部",
            // 待拍单 问题订单
            filterModel: [
                {
                    name: "全部",
                    value: "0",
                }, {
                    name: "未付款",
                    value: "1",
                    type: "payStatus"
                }, {
                    name: "已付款",
                    value: "2",
                    type: "payStatus"
                }, {
                    name: "待发货",
                    value: "waitsellersend",
                    type: "transactionStatus"
                }, {
                    name: "待收货",
                    value: "waitbuyerreceive",
                    type: "transactionStatus"
                }, {
                    name: "待收货到账",
                    value: "12",
                    type: "payStatus"
                }, {
                    name: "交易成功",
                    value: "success",
                    type: "transactionStatus"
                }, {
                    name: "退款中",
                    value: "waitbuyersend",
                    type: "refundStatus"
                },{
                    name: "交易关闭",
                    value: "terminated",
                    type: "transactionStatus"
                }
            ],
            tabValue: {
              index: '0'
            }
        };
    },

    computed: {
        getfilterModel() {
            return this.filterModel
        }
    },

    mounted() {

    },

    methods: {
        async getTicketList(current, size) {
            const { data } = await ticketList(current, size)
            return data
        },
        async handleClick(value) {
            this.tabValue = value
            this.activeName = this.filterModel[value.index].name
        },
    },
};
</script>

<style lang="scss" scoped>
.box-card {
    margin: 0 20px;
}
</style>
